package net.alan.modules.bean;

/**
 * http请求返回的最外层对象
 * Author 李岩飞
 * Email eliyanfei@126.com
 * 2017/11/21
 */
public class ResultUtil {

    public static Result success(Object object) {
        Result result = new Result();
        result.setMsg("成功");
        result.setStatus(true);
        result.setData(object);
        return result;
    }

    public static Result success() {
        return success(null);
    }

    public static Result error(String msg) {
        Result result = new Result();
        result.setMsg(msg);
        result.setStatus(false);
        return result;
    }
    public static Result noRole() {
        Result result = new Result();
        result.setMsg("没有权限操作");
        result.setStatus(false);
        return result;
    }
}
